import { proxyRequest } from '@core/utils/request';

export interface CasUser {
  domainid: string,
  loginip: string,
  logintime: string,
  userid: string,
}

export default class CtCas {
  static fetchMe = () => proxyRequest.get<any, CasUser>('/me');

  static toValidateTicket = (ticket: string) => proxyRequest.get<any, void>(
    '/casClient/toValidate',
    { params: { ticket } },
  );

  static logout = () => proxyRequest.get<any, { redirectTo: string }>('/logout');
}
